<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<style>
body{
width:500px;
}
</style>
</head>
<body onload="window.print();">
<h3></h3>

<script type="text/javascript">
    var newwindown;
    function showWindow(order_id)
    {
    	var url = "/admin/order/printer/"+order_id;
        newwindown = window.open(url,"newwindown","menubar=yes,width=280px,height=300px,scrollbars=yes,resizable=no");
		
    }
     function aa()
{
	var url = document.location.href;
	if(url.lastIndexOf("status=0") != -1)
	 document.location.href = url;
}
setInterval("aa()",60000);
    </script>



<?php 
$lang = "vi";
$row=$result;


echo form_open_multipart('admin/order/update/'.$row['order_id']); 

?>


<div class="box">


<div style="text-align:center;font-size:12px;padding:10px;color:#006699"><h2>Thông Tin Đơn đặt hàng</h2> </div>
<div class="inner"style="margin-left:63px;">



<?php


$label ="Tình Trạng: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";

		echo form_label($label);
//echo form_label("Đã Giao Hàng"); echo form_checkbox($data);
		if($row['delivered'] == 0 )
		{
			
			if($row['deleted'] == 1 )
			{
				echo "Chưa Giao Hàng - <font color='red'>Đã Xóa</font> ";
			}
			else
				echo "Chưa Giao Hàng";
		}
		else if($row['delivered'] == 1 )
		{
			if($row['deleted'] == 1 )
			{
				echo "Đã Giao Hàng - <font color='red'>Đã Xóa</font> ";
			}
			else
				echo "Đã Giao Hàng";
	
	
			
		}
?>

</div>
<?php
		$cus_name = unserialize($row['name']);
			
//		$info = unserialize($row['others_info']);
	
		//title  vi

echo '<div class="inner" style="margin-left:60px;">';
	//$code = "title_vi";
	$label ="&nbsp;Số Hóa Đơn:   &nbsp;&nbsp&nbsp;&nbsp;";

	//if (! empty($missing) && array_key_exists($code, $missing))

	//	echo form_label($label, '', array('class'=>'error'));

//	else

		echo form_label($label);
//	$data= array( 'name'=>$code,'value'=>html_entity_decode($name['vi'],ENT_QUOTES,"UTF-8"));
//	echo form_input($data, set_value($code));
	echo form_label("#".$row["order_id"]);


	echo '</div>';
	//title en
	
	echo '<div class="inner" style="margin-left:65px;">';
//	$code = "title_en";
	$label ="Họ Tên KH:   &nbsp;&nbsp;&nbsp;&nbsp;";

	//if (! empty($missing) && array_key_exists($code, $missing))

		//echo form_label($label, '', array('class'=>'error'));

//	else

		echo form_label($label);
//	$data= array( 'name'=>$code,'value'=>html_entity_decode($name['en'],ENT_QUOTES,"UTF-8"));
//	echo form_input($data, set_value($code));
echo form_label(html_entity_decode($cus_name["full"],ENT_QUOTES,"UTF-8"));
	echo '</div>';




?>
<div style="text-align:center;font-size:12px;padding:10px;color:#006699"><h2>Chi Tiết Đơn Đặt Hàng<?php //$this->lang->line('pages_detail');?></h2> </div>
<div class="inner" >
<table width="460"   border="1" style="margin-left:20px;margin-top:5px;border-spacing:0px">
    <tr style="color:#990000;">
    <!-- 	<th> STT </td>
       <th> Hình ảnh </td> -->
        <th width="250"> Tên Sản Phẩm </td>
        <th width="90"> Giá </td>
        <th width="40"> Số Lượng </td>
        <th width="90"> Thành tiền </td>
        
    
    </tr>

<?php
	foreach ($order_detail as $item)
	{
		$prod_name = unserialize($item["name"]);
		echo "<tr style='border-bottom:1px dotted #fff;line-height:30px;'>";
		//	echo "<td> </td>";
			echo "<td style=''> ".$prod_name[$lang]." </td>";
			echo "<td style='text-align:right'>".number_format($item['price'],0,".",",")." VND </td>";
			echo "<td style='text-align:right'> ".$item['quantity'] ."</td>";
			
			echo "<td style='text-align:right'>  ". number_format($item['sub_total'],0,".",",") ." VND </td>";
		
			echo "</tr>";
	}
	echo "<tr>";
	echo "<td colspan=4 style='text-align:right;line-height:30px;'> ";
	echo "<font color=red> Tông Cộng:". number_format($row["total"],","). "  VND</font>";
	echo "</td>";
	echo "</tr>";
echo "</table>";
echo "</div>";

	
	
	

?>

</div><!--end box-->



<?php

	echo form_close(); //FORM END

?>


        </body>
</html>
